home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-06-14 | 8.1 KB | 189 lines | [TEXT/MPS ] |
- Copyright 1987-1989, Eduard Schwan Programs [esp]
- All rights reserved
- TLC (The Last C-Cross-Referencer) and TLP (same, but for
- Pascal) are Source Code Cross-Reference Generators crafted
- and shot into the Public Domain by Eduard Schwan. The
- source code, documentation and executable program may be
- freely distributed as long as the copyright/author notices
- remain intact, and it is not used in part or whole as the
- basis of a commercial product without the author's
- permission. Any comments, bug-fixes, ports or enhancements
- are most welcome. Also, if you find TLC and it's source
- code useful, a contribution of $20 (check/money order) is
- encouraged! Hopefully we will all see more source code
- distributed!
- Eduard Schwan, 1112 Oceanic Drive, Encinitas, Calif. 92024
- (619) 632-0466 5:00PM - 8:00PM PST
- --------------------------------------------------------------------------
-
- A quick note about the source code:
-
- There are really two programs intertwined in this source.
- TLC is a C source cross-referencer, and TLP (a recent
- addition) is a Pascal source cross- referencer. I wanted
- to put a real parser in here to help identify variable
- usage (declaration, reference, assignment), but of course,
- it was needed before it was done, and some quickie smarts
- were inserted instead, just to get it working. Of course,
- I have not yet gone back to replace the parser, and
- probably never will.. it is good enough for me, and I'm
- lazy! Anyway, TLC came first, and all the files named
- TLCxxxx.C are needed to compile TLC. TLP came later as an
- appendage to TLC. It uses many of these TLCxxx files too,
- and it additionally needs all the TLPxxxx.C files. The MPW
- Make files are included here (TLC.MAKE and TLP.MAKE), but a
- table below should show you who uses what.
-
- DOCUMENT NEEDED BY NEEDED BY NEEDED BY
- FILE BOTH TLC TLP
- --------- ---------- ----------- -----------
- readme.tlc tlc.ext tlc.c tlp.c
- tlcHelp.Doc tlc.h tlc.make tlp.make
- tlccmd.c tlcgtok.c tlpgtok.c
- tlcparm.c tlcparm.dat tlpparm.dat
- tlcparm.h tlcprocf.c tlpprocf.c
- tlcresw.c tlcresw.dat tlpresw.dat
- tlcsetp.c
- tlcstat.c
- tlcutil.c
- tlcxref.c
-
-
- Source code history:
-
- TLC was originally written on a 64k Apple II+ in Aztec C65,
- then ported to APW C on an Apple IIGS, then to MPW C on an
- Apple Macintosh II. I have not done any regression testing
- after adding the compiler switches, but it should still run
- on a IIGS (It does compile..:). I am sure it has grown far
- too big for even the Aztec Interpreted C on the Apple II. I
- have not yet ported it to an MS-DOS machine, but it should
- go about as smoothly as the other ports.
-
- I have not made an effort to group machine-specific
- functions, but they hopefully just turned out that way..
- all in TLCUTIL.C. Namely get_time(), get_mem(),
- check_user_abort(), and maybe do_form_feed(). Also check
- out TLC.H thoroughly. Some interesting constants are hiding
- in there. You shouldn't need to diddle any of them, unless
- you are porting it to another machine.
-
- This has been a three year (not-so-copious) spare-time
- effort on my part, and I am hoping that this will be as
- useful to you as it has been to me. If you are interested
- in porting this to yet another machine, or have comments or
- bug reports, or just want to say "hi" or send me money,
- please do feel free to contact me. I am on AppleLink
- (JL.TECH, atten:Eduard Schwan), or at the address below.
- If you need serious quick assistance, I can be reached at
- home at the phone number listed, at the time listed.
- Have fun with it! TTFN,
-
- Eduard Schwan
- 1112 Oceanic Drive
- Encinitas, California 92024
- (619) 632-0466 between 5:00pm and 8:00pm PST only, please.
-
- --------------------------------------------------------------------------
-
- These are the known bugs/features-to-be-added to
- The Last [C/Pascal] Cross-referencer, as of 7/02/89 (v1.01) [esp]:
-
- 1:Xref case-sensitivity isn't here yet (do_case_sens/do_xcase_sens).
- That is, one can't have case-sens. ids without having case-sens.
- xref sorting, or vice versa. DoCaseSens works, but DoXcaseSens
- is ignored. The way I did the symbol table, it is an icky chore
- and may never show up, but hey, I haven't needed it yet either.
-
- 2:Underscore-significance (Pascal) isn't here yet.
- (now it is.. 0.90 beta)
-
- 3:Include file handling isn't here yet. Not only that, but the scanner
- doesn't recognize the <incfile.h> as a string, so "incfile" and "h"
- show up as separate xref'ed identifiers (hmm, could be called a feature?)
-
- 4:The full-blown parser isn't here yet, instead some quickie C smarts
- were kludged into the scanner (tlc.gtok.c) to make this useable in
- a "reasonable" time frame.
- (NOTE: as of 1.01, it now looks like a pain to retrofit it in..)
-
- 5:The symbol table is 100% memory-resident, and therefore the size of
- the source code you throw at TLC is limited by available heap space.
- Another parameter (DO_BIG_XREF?) should be added that makes tlc/tlp
- call alternate symbol table routines that do disk I/O..
-
- 6:The statistics option should print out more interesting stuff someday..
- (v1.00 added a list of file names..)
-
- 7:The Macintosh version should be jazzed up with heap-avail displayed
- every once in awhile, and it needs a commando interface for us lazies,
- and the time/date need to be called & stuck into ctime_string in
- tlc.util.c.
- (heapAvail & time/date was just fixed in 0.95 beta, so ??? no longer
- appears for time/date.)
-
- 8:An fopen() in MPW C (Macintosh) creates a typeless, creatorless file
- (to be expected, really) which means the output text file (TLC.OUT)
- cannot immediately be read by any text editors. I could either:
- 1. make TLC write to stdout & redirect
- 2. tell users to type "setfile -t TEXT -c 'MPS ' tlc.out" after
- running TLC in MPW, or
- 3. find a way to set the TYPE of the file inside TLC.
- C purists would argue that redirecting to stdout is the way it should be
- done, to which I say, "yeah, I should have made it that way in the
- beginning.." It doesn't look that hard to change, but I am still
- pondering the ramifications..
-
- 9:TLC knows what a function declaration is by blindly deciding that any
- identifier followed by an open paren (that is not a #define macro) at
- block level zero is a function decl. This works 100% of the time when
- the C source code's { } match up. But the following (avoidable) practice
- will goof up TLC's ability to detect functions beyond this point:
- a = b;
- if (a == 1)
- #ifdef debug_on /* TLC ignores conditional compilation & does it all */
- { /* in one.. */
- b = 3;
- #else
- { /* in two.. */
- b = 4;
- #endif
- } /* out two.. but not to one! */
-
- This can be avoided by fully capturing (or not capturing) braces in
- conditionals:
- a = b;
- if (a == 1)
- #ifdef debug_on
- { /* in one.. */
- b = 3;
- } /* out one */
- #else
- { /* in one again.. */
- b = 4;
- } /* out one */
- #endif
-
- 10:Emphasis only works on the xref symbols. It doesn't yet work for
- function headers, comments, or reserved words in the listing output.
-
- 11:I think TLC sometimes forgets a reference or two in BIG xref.s with
- lots of files. I think I have only seen it happen, but only a couple
- of times, and am tracking it down now.
- (Fairly exhaustive debugging with lotsa xreffed files turned up nothing..
- I am giving up this search until a known repeatable occurrance is found,
- so v1.00 may still have this problem!?)
- (Aha! Found! TLC was skipping the last line of every file.
- If it happened to be an end-comment, then TLC would continue to
- think it was in a comment as it went into the next source file..
- until it found the first end comment there!)
-
- 12:If only a cross-reference is done, a bunch of spaces are put in the
- beginning of the file. I think TLC.PROCF.C is the culprit, and not
- all output is suppressed..
- (Nope, it was new_page, fixed it with an additional parm. in v1.00)
-
- 13:The source file names were changed in v1.00 to names edible by the
- MS-DOS community, just in case portability happens.. All names with
- multiple periods got the 1st period stripped (TLC.PROCF.C => TLCPROCF.C)
-